﻿using GetSlaughterItem.API.Application.Commands.Week01.UsersCommends;
using GetSlaughterItem.API.Application.Commands.Week02.Check_In;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using SlaughterItem.API.Application.Commands.Week01.SectionCommands;
using SlaughterItem.Common.Dtos;

namespace GetSlaughterItem.API.Controllers.WangHaoQi
{
    /// <summary>
    /// 进场登记控制器 读取
    /// </summary>
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class CheckInController : ControllerBase
    {
        private readonly IMediator mediatora;

        public CheckInController(IMediator mediator)
        {
            mediatora = mediator;
        }
        /// <summary>
        /// 供应商下拉绑定
        /// </summary>
        /// <param name="cmd"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<Result> SupplierShow()
        {
            return await mediatora.Send(new SupplierShowCommand());
        }
        /// <summary>
        /// 结算类型下拉绑定
        /// </summary>
        /// <param name="cmd"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<Result> SettlementTypeShow()
        {
            return await mediatora.Send(new SettlementTypeShowCommand());
        }
        /// <summary>
        /// 进场状态下拉绑定
        /// </summary>
        /// <param name="cmd"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<Result> CheckInStateShow()
        {
            return await mediatora.Send(new CheckInStateShowCommand());
        }
        /// <summary>
        /// 进场登记显示分页
        /// </summary>
        /// <param name="cmd"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<Result> CheckInShow(CheckInShowCommand cmd)
        {
            return await mediatora.Send(cmd);
        }

        /// <summary>
        /// 进场登记绑定下拉
        /// </summary>
        /// <param name="cmd"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<Result> CheckIn2Show(CheckInShow2Command cmd)
        {
            return await mediatora.Send(cmd);
        }

    }
}
